<template>
  <div class="tab1_wrap">
    <div class="tab1_table">
      <el-table
        border
        class="jk_common_table004"
        :data="tableData"
        height="style"
        style="width: 100%; height: 100%"
      >
        <el-table-column label="序号" align="center" width="50">
          <template slot-scope="scop">
            {{ scop.$index + 1 }}
          </template>
        </el-table-column>
        <el-table-column
          prop="name"
          label="参数名称"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="desc"
          label="参数描述"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="type"
          label="参数类型"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="sdz"
          label="设定值"
          align="center"
        ></el-table-column>
        <el-table-column label="逻辑判断" align="center">
          <template slot-scope="scope">
            <div class="table_flag_seclet">
              <el-select
                class="js_common_select"
                v-model="scope.row.flagStr"
                popper-class="js_common_fenyeqi_popper"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in tableSelectOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" width="140">
          <template slot-scope="scope">
            <div class="table_caozuo_btns_list">
              <div class="table_caozuo_btn" @click="onEditItemFn(scope.row)">
                编辑
              </div>
              <div class="table_caozuo_btn" @click="onDelItemFn(scope.row)">
                删除
              </div>
            </div>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      tableData: [
        {
          id: "001",
          name: "参数1",
          desc: "离线状态规则,",
          type: "模拟量",
          sdz: "0",
          flagStr: "与",
        },
        {
          id: "002",
          name: "参数2",
          desc: "离线状态规则,",
          type: "模拟量",
          sdz: "0",
          flagStr: "与",
        },
        {
          id: "003",
          name: "参数3",
          desc: "离线状态规则",
          type: "模拟量",
          sdz: "0",
          flagStr: "与",
        },
        {
          id: "004",
          name: "参数4",
          desc: "离线状态规则,",
          type: "模拟量",
          sdz: "0",
          flagStr: "与",
        },
        {
          id: "005",
          name: "参数5",
          desc: "离线状态规则,",
          type: "模拟量",
          sdz: "0",
          flagStr: "与",
        },
        {
          id: "006",
          name: "参数6",
          desc: "离线状态规则离线状态规则离线状态规则,",
          type: "模拟量",
          sdz: "0",
          flagStr: "与",
        },
        {
          id: "007",
          name: "参数7",
          desc: "离线状态规则离线状态规则离线状态规则,",
          type: "模拟量",
          sdz: "0",
          flagStr: "与",
        },
        {
          id: "008",
          name: "参数8",
          desc: "离线状态规则离线状态规则离线状态规则离线状态规则,",
          type: "模拟量",
          sdz: "0",
          flagStr: "与",
        },
        {
          id: "009",
          name: "参数1",
          desc: "离线状态规则离线状态规则离线状态规则离线状态规则,",
          type: "模拟量",
          sdz: "0",
          flagStr: "与",
        },
        {
          id: "0010",
          name: "参数1",
          desc: "离线状态规则离线状态规则离线状态规则,",
          type: "模拟量",
          sdz: "0",
          flagStr: "与",
        },
      ],
      tableSelectOptions: [
        {
          value: "与",
          label: "与",
        },
        {
          value: "或",
          label: "或",
        },
        {
          value: "非",
          label: "非",
        },
      ],
    };
  },
  methods: {
    onEditItemFn(item) {
      console.log(item);
    },
    onDelItemFn(item) {
      console.log(item);
    },
  },
};
</script>
<style lang="scss" scoped>
.tab1_wrap {
  width: 100%;
  height: 100%;
  background-color: #0f2245;
  .tab1_table {
    width: 100%;
    height: 100%;
    .table_flag_seclet {
      width: 80px;
      margin: 0 auto;
    }
    .table_caozuo_btns_list {
      display: flex;
      align-items: center;
      justify-content: center;
      .table_caozuo_btn {
        margin-left: 16px;
        color: #387bb6;
        cursor: pointer;
        &:hover {
          text-decoration: underline;
        }
        &:first-child {
          margin-left: 0;
        }
      }
    }
  }
}
</style>
